<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2022/11/28
  Time: 21:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="bean.Apply" %>
<%@ page import="bean.ApplyBean" %>
<jsp:useBean id="applyBean" class="bean.ApplyBean" scope="application"/>
<%@ page import="bean.JudgeBean" %>
<%@ page import="bean.Judge" %>
<jsp:useBean id="judgeBean" class="bean.JudgeBean" scope="application"/>
<style>
    #tom{
        font-family:宋体;font-size:20;
    }
</style>
<style>
    body {
        background: url(../image/sport.png) no-repeat center center fixed;
        /*兼容浏览器版本*/
        -webkit-background-size: cover;
        -o-background-size: cover;
        background-size: cover;
    }
</style>
<html>
<body id="tom">
<center>
    <h1>欢迎来到河南工业大学运动会管理系统！</h1>
    <table border="1">
        <tr>
            <th width="80">项目编号</th>
            <th width="80">选手姓名</th>
            <th width="150">项目名称</th>
            <th width="20">成绩</th>
            <th width="30">得分</th>
        </tr>
        <%
            applyBean=(ApplyBean) application.getAttribute("applyBean");
            judgeBean=(JudgeBean) application.getAttribute("judgeBean");
            judgeBean.link();
            judgeBean.getJudgeArrayList().clear();
            judgeBean.loadJudge();
            String referee=(String)session.getAttribute("userID");
            applyBean.link();
            applyBean.getApplyArrayList().clear();
            applyBean.loadApply();
            for(Judge j:judgeBean.getJudgeArrayList()){
                if(referee.equals(j.getReferee())){
                    for(Apply i:applyBean.getApplyArrayList()){
                        if(j.getId().equals(i.getId())){
                            out.println("<tr class='test-c'>");
                            out.println("<td>"+i.getId()+"</td>");
                            out.println("<td>"+i.getName()+"</td>");
                            out.println("<td>"+i.getItemName()+"</td>");
                            out.println("<td>"+i.getResult()+"</td>");
                            out.println("<td>"+i.getGrade()+"</td>");
                            out.println("</tr>");
                        }
                    }
                }
            }
        %>
    </table>
    <form action="MarkServlet" method="post">
        请输入要评分的编号:<input type="text" size="10" name="id"/><br>
        请输入要评分的参赛选手:<input type="text" size="10" name="name"/><br>
        请输入评分:<input type="text" size="10" name="goal"/><br>
        <br><input type="submit" name="submit" value="评分">
    </form>
    <%
        String info = (String) session.getAttribute("markInfo");
        if (info != null){
            out.print(info);
        }
    %>
    <a href="referee_index.jsp">返回</a>
</center>
</body>
</html>